//  https://www.luogu.com.cn/problem/P5322

#include<iostream>
#include<algorithm>
using namespace std;

const int N = 110, M = 20010;
int n, m, s;
int dp[N][M];
int a[N][N];

int main()
{
    cin >> s >> n >> m;
    for (int i = 1;i <= s;i++)
    {
        for (int j = 1;j <= n;j++)
        {
            cin >> a[j][i];
            a[j][i] = a[j][i] * 2 + 1;
        }
    }
    for (int i = 1;i <= n;i++)
        sort(a[i] + 1, a[i] + 1 + s);

    for (int i = 1;i <= n;i++)
        for (int j = 0;j <= m;j++)
        {
            dp[i][j] = dp[i - 1][j];
            for (int k = 1;k <= s && a[i][k] <= j;k++)
                dp[i][j] = max(dp[i][j], dp[i - 1][j - a[i][k]] + i * k);
        }
    cout << dp[n][m];
    return 0;
}